﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using E.Model;
using E.Web.UI.Page;
using X.Common;
using E.BLL;

namespace E.Web.Teacher.internals.question
{
    public partial class QuestionDefaultScoreSet : TeacherBasePage
    {
        public IList<QuestionCategoryModel> listModel;
        public string act;

        protected override void ShowPage()
        {
            act = XRequest.GetString("act");
            listModel = (new QuestionBLL()).GetAllQuestionCategoryModel();

            if (ispost || act == "save")
            {

                foreach (QuestionCategoryModel model in listModel)
                {
                    int updateScore = XRequest.GetInt( model.ID.ToString(), model.DefaultScore);
                    model.DefaultScore = updateScore;
                    (new QuestionBLL()).UpdateQuestionCategoryDefaultScore(model);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}